home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / PRGMANIA / VERSION1.5 / AUDIO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-16  |  2.0 KB  |  60 lines

  1. #ifndef __AUDIO__
  2. #define __AUDIO__
  3.  
  4. typedef struct
  5. {
  6. #define AVR_MAGIC    0x32424954
  7.     long avr_magic;                    // '2BIT'
  8.     char avr_name[8];                // sample name
  9. #define AVR_MONO    0
  10. #define AVR_STEREO    -1
  11.     short avr_mode;                    // mono/stereo
  12. #define AVR_UNSIGNED    0
  13. #define AVR_SIGNED    -1
  14.     short avr_resolution;            // sample resolution
  15.     short avr_signed;                // signed/unsigned sample
  16. #define AVR_NON_LOOPING    0
  17. #define AVR_LOOPING    -1
  18.     short avr_looping;                // looping sample control
  19. #define AVR_NOTE_NONE    -1
  20.     short avr_midinote;                // assigned midi note
  21.     unsigned long avr_frequency;    // sample frequency
  22.     unsigned long avr_length;        // sample length
  23.     unsigned long avr_loop_first;    // offset of first loop
  24.     unsigned long avr_loop_end;        // offset of end loop
  25.     char avr_reserved[6];            // reserved
  26.     char avr_xname[20];                // sample name extension area
  27.     char avr_user[64];                // user commitable area
  28. } avr_t;
  29.  
  30. /*
  31.  * This is the sample list definition. It consists of a doubly linked
  32.  * list of entries containing the samples which are available in the
  33.  * current sample directory.
  34.  */
  35. typedef struct samp_list
  36. {
  37.     struct samp_list *suiv;        /* Sample suivant dans la liste ou NULL   */
  38.     char name[128];                        /* Chemin + Nom du fichier sample         */
  39.     int entete;                                /* Taille de l'entete                     */
  40.     int type;                                    /* Type du sample                         */
  41.     long length;                            /* Taille du sample                       */
  42.     short rate;                                /* Fréquence du Sample                    */
  43.     short mode;                                /* Mono = 0, Stereo = -1                  */
  44.     char smp_name[29];                /* Nom du sample : 28 caractères          */
  45.     char alias[9];                        /* Alias = nom utilisateur du sample      */
  46. } SAMPLE;
  47.  
  48. #define SMP_AVR 1                        /* Pour l'instant, un seul type                     */
  49.  
  50. int AudioInit (void);
  51. void AudioExit (void);
  52. void AjouteSample (int type, char *nom, char *alias);
  53. void EnleveSample (char *alias);
  54. int PlaySample (char *alias);
  55.  
  56. #define SND_LOCK -1
  57. #define SND_OK  0
  58.  
  59. #endif
  60.